package generator.src.util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

/**
 * 其他工具类
 * @author 黄为涛
 *
 */
public class TaoUtil {
	//配置文件路径
	private static final String CONFIGPATH = System.getProperty("user.dir")+"\\src\\main\\resources\\generatorConfig.properties"; 
	/**
	 * 获取该项目的绝对路径
	 * @return
	 */
	public static String  getProjectPath() {
		
		return null;
	}
	/**
	 * 获取配置文件中的值
	 * @param key
	 * @return
	 * @throws IOException
	 */
	public static String getProperty(String key) throws IOException {
		BufferedReader br = null;
		Properties datas = new Properties();
		br = new BufferedReader(new InputStreamReader(new  FileInputStream(CONFIGPATH), "UTF-8"));
		datas.load(br);
		String value =  datas.getProperty(key);
		return value;
	}

}
